"""
__author__ = '霍格沃兹测试开发学社'
__desc__ = '更多测试开发技术探讨，请访问：https://ceshiren.com/t/topic/15860'
"""
import os
import yaml


class Utils:

    @classmethod
    def get_yaml_data(cls, file_path):
        '''
        读取 yaml 文件方法
        file_path 为 yaml 文件路径
        '''
        with open(file_path, encoding="utf-8") as f:
            datas = yaml.safe_load(f)
        return datas

    @classmethod
    def get_frame_root_path(cls):
        '''
        获取测试框架项目的路径
        '''
        return os.path.dirname(os.path.dirname((os.path.abspath(__file__))))